﻿@model CommerceOne.Models.CartViewModel

<div class="art-content-layout">
    <div class="art-content-layout-row">
        <div class="art-layout-cell art-sidebar1">
            @Html.Partial("_LeftCategoryNav", @Model.LeftCategoryNavViewModel)
            @Html.Partial("_LeftBrandNav", @Model.LeftBrandNavViewModel)

            <div class="art-block">
                <div class="art-block-body">
                    <div class="art-blockcontent">
                        <div class="art-blockcontent-body">
                            <div>
                                <input type="text" value="" name="email" id="s" style="width: 95%;" />
                                <input type="button" name="search" class="art-button" value="Subscribe" />
                            </div>
                            <div class="cleared">
                            </div>
                        </div>
                    </div>
                    <div class="cleared">
                    </div>
                </div>
            </div>
            <div class="cleared">
            </div>
        </div>
        <div class="art-layout-cell art-content">
            
            <table width="90%" align="center">
                <thead>
                    <tr>
                        <th align="center">Quantity</th>
                        <th align="left">Item</th>
                        <th align="right">Price</th>
                        <th align="right">Subtotal</th>
                        <th align="right"></th>
                    </tr>
                </thead>
                <tbody>
                    @foreach(var line in Model.Cart.ProductLine) { 
                        <tr>
                            <td align="center">@line.Quantity
                            </td>
                            <td align="left">@line.Name
                            </td>
                            <td align="right">@line.Price.ToString("c")
                            </td>
                            <td align="right">@line.SubTotal.ToString("c")
                            </td>
                            <td align="right">
                            @using (Html.BeginForm("Remove", "Cart"))
                            {         
                                @Html.Hidden("id", line.Id) 
                                @Html.HiddenFor(x => x.ReturnUrl) 
                                <input class="actionButtons" type="submit" value="Remove" /> 
                            } 
                            </td>
                        </tr> 
                }
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="3" align="right">
                            Total:
                        </td>
                        <td align="right">
                            @Model.Cart.ComputeTotal().ToString("c")
                        </td>
                    </tr>
                </tfoot>
            </table>
            <p align="center" class="actionButtons">
                <a href="@Model.ReturnUrl">Continue shopping</a>
                @Html.ActionLink("CheckOut", "CheckOut");
            </p>
            <div class="cleared">
            </div>
        </div>
    </div>
</div>